/*
 * @Date: 2020-11-27 18:38:43
 * @LastEditors: 小枫
 * @description: description
 * @LastEditTime: 2020-11-27 20:43:58
 * @FilePath: \stu-nest\src\modules\users\users.controller.ts
 */
import { Body, Controller, Get, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { UsersService } from './users.service';
import { User } from '../../classes/user.dto';

@Controller('users')
@ApiTags('users')
export class UsersController {
  constructor(private readonly usersService: UsersService) {}

  @Get('all')
  getAll() {
    return this.usersService.findAll();
  }

  @Post('save')
  async createOne(@Body() user: User) {
    await this.usersService.create(user);
    return true;
  }
}
